package com.ws.user.role.service.impl;

import com.ws.common.easyui.util.Page;
import com.github.pagehelper.PageHelper;
import com.ws.user.role.dao.RoleMapper;
import com.ws.user.role.entity.Role;
import com.ws.user.role.service.IRoleService;
import com.ws.common.base.service.Impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RoleServiceImpl extends BaseServiceImpl<Role> implements IRoleService{

	@Autowired
	RoleMapper roleMapper;

	@Override
	public List<Role> list(Role params) {
		return roleMapper.list(params);
	}

	@Override
	public List<Role> list(Role params, Page page) {
		PageHelper.startPage(page.getPage(),page.getRows(),page.getSortOrder());
		return roleMapper.list(params);
	}

	@Override
	public Integer save(Role role) {
		return this.insertOrUpdate(role);
	}
}
